# 推导式

# for in range(start,stop,step)

list1 = [i for i in range(1, 11)]
print(list1)

list2 = [i for i in range(2, 21, 2)]
print(list2)

list3 = [i for i in range(2, 21) if i % 2 == 0]
print(list3)

list4 = [(i, j) for i in range(3) for j in range(3)]
print(list4)

dic1 = {key: key ** 2 for key in range(6)}
print(dic1)

li1 = ['name', 'age', 'gender']
li2 = ['Tom', 20, 'man']
dic2 = {li1[i]: li2[i] for i in range(len(li1))}
print(dic2)

counts = {'MBP': 268, 'HP': 125, 'DELL': 201, 'Lenovo': 199, 'acer': 99}
dic3 = {key: value for key, value in counts.items() if value >= 200}
print(dic3)

li3 = [1, 1, 2]
li4 = {i ** 2 for i in li3}
print(li4)
